package java7;

import javax.naming.OperationNotSupportedException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.ZipFile;


/**
 * Created by richard on 5/18/14.
 */
public class Others {
    public static void main(String[] args){

    }
    public void switchEhance(String s){
        switch (s){
            case "1": System.out.println("1");
            case "2" : System.out.println("2");
            default : System.out.println("others");
        }
    }

    public void exceptionEnhance(String s){
        try{
            if(s.equals("1"))
            throw new IllegalArgumentException();
            if(s.equals("2"))
            throw new OperationNotSupportedException();
        }
        catch (IllegalArgumentException  | OperationNotSupportedException e2){

        }
    }

    public void resourceEnhance(String s){
        try(ZipFile file = new ZipFile(s)) {
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

    public void genericEnhance(){
        List<String> list = new ArrayList<>();
    }

    public void numEnhance(String s){
        int i = 123_456;
    }
}
